package com.itdct.onflow.core.constant

/**
 * Created by DCT-Portable on 2021/4/7 22:57.
 * Usage:
 */
object ReturnCode {
    const val SUCCESS: Int = 200 //200~299皆为成功

    //业务逻辑类出错
    const val REQUEST_DATA_ERROR: Int = 400 //Bad
    const val SYSTEM_ERROR: Int = 500
    const val NOT_FOUND_ERROR: Int = 501
    const val LACK_PARAM: Int = 502
    const val VALIDATE_ERROR: Int = 510 //参数校验出错
    const val DICT_ERROR: Int = 520 //字典错误

    //数据库内部出错
    const val MULTI_CHANGE_ERROR: Int = 550 //对象提交冲突出错
    const val UNIQUE_CONSTRAINT_ERROR: Int = 551 //违反了唯一键出错
    const val QUERY_ERROR: Int = 552 //Dao内部查询出现问题
    const val DELETE_ERROR: Int = 560 //对象删除出错

    //登录类别出错
    const val UNAUTHORIZED: Int = 401
    const val PERMISSION_FORBIDDEN: Int = 403
    const val API_NOT_FOUND: Int = 404


    //代码编写疏漏
    //未捕获的异常出错
    const val UNCAUGHT_SYSTEM_ERROR: Int = 900

}
